class Gamerules extends eui.Component implements eui.UIComponent {
	public constructor() {
		super();
		this.skinName = "GamerulesSkin";

	}

	protected partAdded(partName: string, instance: any): void {
		super.partAdded(partName, instance);
	}
	static isopen;
	private baidi;
	private rankings;
	private go;
	return: eui.Image;
	protected childrenCreated(): void {
		super.childrenCreated();
		this.return.addEventListener("touchTap", this.return_tap, this);
		this.baidi.play();

		// 查看排名按钮
		this.rankings.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
			let winners = new Winners();
			winners.returnfan.once(egret.TouchEvent.TOUCH_TAP,function(){
				this.removeChild(winners);
				winners = null;
			},this)
			this.addChild(winners);
		},this)

		// 开始游戏
		this.go.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
			console.log('bgg')
			SceneManager.getObj(this.stage).loadScene("game", bgRun)
		},this)
	}
	/**开关 */
	public isopen: boolean = false;
	public return_tap(): void {
		this.isopen = true;
		Gamerules.isopen = true;
	}
}